CC = gcc
CFLAGS = -I/home/Administrator/tongsuo/include/ -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32 -I./include -Wall -O2
LDFLAGS = -L/home/Administrator/tongsuo/lib64 -lssl -lcrypto -Wl,-rpath=/usr/local/tongsuo/lib64
TARGET = lib/libgmjni.dll
 
DIRS = sm2 sm3 sm4
SRCS = $(foreach dir, $(DIRS), $(wildcard $(dir)/*.c))
OBJS = $(SRCS:.c=.o)

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) -shared -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f $(OBJS) $(TARGET)
 
.PHONY: all clean